package com.truyen.service;

import java.util.List;

import com.truyen.persistence.entity.TacGia;
import com.truyen.persistence.entity.TruyenTrinhTham;
import com.truyen.utils.PagingInfo;


public interface TruyenTrinhThamService {
	
	// tao moi
	void save(TruyenTrinhTham entity);

	//tim theo id
	TruyenTrinhTham findById(Long id);

	//lay tat ca
	List<TruyenTrinhTham> getAll();

	//tim truyen theo cot va gia tri cua cot
	TruyenTrinhTham findByProperty(String column, Object value);

	//lay list truyen tranh link image nulll tu blog truyen
	List<TruyenTrinhTham> getLstComicLinkImageNullBlogTruyen(int sourceBy);

	//lay danh sach truyen theo cac dieu kien va co phan trang
	List<TruyenTrinhTham> getAllLst(String kwSearch, String sort, String sortBy, PagingInfo pInfo);

	//set hot truyen
	void setHot(Long id);

	//set is delete
	void setIsDelete(Long id);

	//lay list truyen va sap xep giam dan them cot
	List<TruyenTrinhTham> getListTruyenBy(String orderByColumn,	int begin, int max);

	//lay list truyen ngau nhien
	List<TruyenTrinhTham> getListTruyenRandom(int maxLimit);

	//update total chapter
	void updateTotalChapterr(Long id, float totalChapter);

	//lay list truyen theo soureBy
	List<TruyenTrinhTham> getLstTruyenBySourceBy(int sourceBy);

	void updateViews(Long id, long views, long viewsWeek, long viewsMonth);

	//hint truyen
	List<Object> getObjectByNameUnsigned(String kwSearch, int max, String typeSearch);

	//danh sach truyen co phan trang
	List<TruyenTrinhTham> getLstByPropertyWithPaging(String column, String value, String sortBy, PagingInfo pInfo);

	//cap nhat liked
	void updateLiked(Long idTruyen, long liked);

	//xoa truyen
	void delete(Long id);

	//danh sach truyen theo column
	List<TruyenTrinhTham> getLstByProperty(String column, Object value, int begin, int max);

	//cap nhat colum string
	void updateColumnString(long id, String column, String value);

	//lay danh sach truyen phan trang sap xep
	List<TruyenTrinhTham> getLstByPropertyWithOrderByPaging(String orderBy, PagingInfo pInfo);

	//lay danh sach truyen theo tac gia co phan trang
	List<TruyenTrinhTham> getLstByTacGiaWithPaging(TacGia TacGia, String orderBy, PagingInfo pInfo);

	//lay danh sach truyen theo tac gia co limit
	List<TruyenTrinhTham> getLstByTacGiaLimit(TacGia TacGia, int begin, int maxLimit);

	//cap nhat truyen
	void update(Long idTruyen, String name, String alias, String linkImage,
			String nameImage, String info, TacGia tacGia, String categories,
			float totalChapter, boolean isDelete, boolean isFinished,
			boolean isHot, long liked, long views, long viewsWeek,
			long viewsMonth, int sourceBy, String linkSource,
			String translator);

	//updateViewsWeek
	void updateViewsWeek();
	
	//updateViewsMonth
	void updateViewsMonth();

	List<TruyenTrinhTham> findByPropertyNotNull(String property);
}
